Closing the Gap - Formally Verifying Dynamically Typed Programs like Statically Typed Ones Using Hoare Logic - Extended Version -
نویسندگان
چکیده
Dynamically typed object-oriented languages enable programmers to write elegant, reusable and extensible programs. However, with the current methodology for program verification, the absence of static type information creates significant overhead. Our proposal is two-fold: First, we propose a layer of abstraction hiding the complexity of dynamic typing when provided with sufficient type information. Since this essentially creates the illusion of verifying a statically-typed program, the effort required is equivalent to the statically-typed case. Second, we show how the required type information can be efficiently derived for all type-safe programs by integrating a type inference algorithm into Hoare logic, yielding a semi-automatic procedure allowing the user to focus on those typing problems really requiring his attention. While applying type inference to dynamically typed programs is a wellestablished method by now, our approach complements conventional soft typing systems by offering formal proof as a third option besides modifying the program (static typing) and accepting the presence of runtime type errors (dynamic typing).
منابع مشابه
A Sound and Complete Hoare Logic for Dynamically-Typed, Object-Oriented Programs - Extended Version -
A simple dynamically-typed, (purely) object-oriented language is defined. A structural operational semantics as well as a Hoarestyle program logic for reasoning about programs in the language in multiple notions of correctness are given. The Hoare logic is proved to be both sound and (relative) complete and is – to the best of our knowledge – the first such logic presented for a dynamically-typ...
متن کاملMonadic Refinement Types for Verifying JavaScript Programs
Researchers have developed several special-purpose type systems and program logics to analyze JavaScript and other dynamically typed programming languages. Still, no prior system can precisely reason about both higher-order programs and mutable state; each system comes with its own delicate soundness proof (when such proofs are provided at all); and tools based on these theories (when they exis...
متن کاملUndoing Dynamic Typing (Declarative Pearl)
We propose undoable versions of the projection operations used when programs written in higher-order statically-typed languages interoperate with dynamically typed ones, localizing potential runtime errors to the point at which a dynamic value is projected to a static type. The idea is demonstrated by using control operators to implement backtracking projections from an untyped Scheme-like lang...
متن کاملRun-time Manipulation of Programs in a Statically-Typed Language
This article is an extended abstract of a doctoral dissertation on metaprogramming and programming language design. A metaprogramming model is studied and implemented in a statically–typed pure object– oriented programming language Zero. The object model of language is based on closures which enables metaprogramming model to achieve a high degree of dynamic manipulation, normally only found in ...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/1501.02699 شماره
صفحات -
تاریخ انتشار 2015